Writing Data to a Text File Using Python